<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>词多多代理商平台</title>
    <include file="Index:header"/>
    <!----自动提示的input引入文件开始---------->
    <link rel="stylesheet" href="__PUBLIC__/css/textext.core.css" type="text/css" />
    <link rel="stylesheet" href="__PUBLIC__/css/textext.plugin.autocomplete.css" type="text/css" />   
    <link rel="stylesheet" href="__PUBLIC__/css/textext.plugin.prompt.css" type="text/css" />
    <script src="__PUBLIC__/js/textext.core.js" type="text/javascript" charset="utf-8"></script>   
    <script src="__PUBLIC__/js/textext.plugin.autocomplete.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/js/textext.plugin.prompt.js" type="text/javascript" charset="utf-8"></script>   
    <!----自动提示的input引入文件结束---------->
    <script type="text/javascript">
        $(function(){
            $(".help-side dl dd:eq(3)").addClass('cur');
        })
        $(function(){
            $("#top #topcon .nav li:eq(2)").addClass('cur');
        })
    </script>
    <script src="__PUBLIC__/js/main.js" type="text/javascript" charset="UTF-8"></script>
</head>

<body>
    <include file="Index:top"/>
    <div id="main">
        <include file="Site:left"/>
        <div id="main_right" class="container">
            <div class="title">推荐精准词</div>
            <div id="infotab" class="container mt10">
                <ul class="tb cl">
                    <li>
                        <a href="{:U('site_keyword_recommend')}">推荐精准词列表</a>
                    </li>
                    <li class="a">
                        <a href="{:U('site_keyword_recommend_add')}">添加推荐精准词</a>
                    </li>
                </ul>

                <form name="form1" id="form1" class="form" showOnMouseOver="false">
                    <table width="570" class="tableStyle mt30 ml70" formMode="transparent">
                        <tr>
                            <td align="right">用&nbsp;&nbsp;&nbsp;户&nbsp;&nbsp;&nbsp;名：</td>

                            <td class="rtd" style="padding-left:25px;">
                                <input id="textarea" type="text" name="name" class="validate[required input]" style="width:220px; z-index:100; "/>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">推荐精准词：</td>
                            <td style="padding-left:25px;">
                                <textarea style="padding:10px;width:200px;height:130px;" name="tj_key" class="validate[required,custom[chinese1] input" id="content">支持多个精准词添加,一行一个</textarea>
                            </td>
                            <td>
                                <div class="validation_info"></div>
                            </td>
                        </tr>
                        <tbody id="keywords"></tbody>
                        <tr style="height:70px;">
                            <td></td>
                            <td style="padding-left: 10px;">
                                <input class="button green" type="button" name="button" id="button" value="提&nbsp;&nbsp;交" onclick="validateForm('#form1','__URL__/site_keyword_recommend_add')"/>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <include file="Index:footer"/>
    <script type="text/javascript">

        $(function() {
            $("#content").text();
            $("#content").css("text-align", "center").css("font-size", "14px").css("line-height", "130px").css("color", "#ccc");
            $("#content").focus(function() {
                var str = $(this).val();
                str = $.trim(str);
                if (str == "支持多个精准词添加,一行一个") {
                    $(this).val("");
                    $("#content").css("text-align", "").css("font-size", "").css("line-height", "").css("color", "");
                }
            });
            $("#content").blur(function() {
                var str = $(this).val();
                str = $.trim(str);
                if (str == "") {
                    $(this).val("支持多个精准词添加,一行一个");
                    $("#content").css("text-align", "center").css("font-size", "14px").css("line-height", "130px").css("color", "#ccc");
                }
            });

        });

    function hash(str, hashSize)
        {
            var result = 0;
            for(var i = 0; i < str.length; i++)
                result += str.charCodeAt(i) + 31 * result;
            return result % hashSize;
        }

        $('#textarea')
            .textext({
                plugins : 'autocomplete',
                autocomplete : {
                    dropdownMaxHeight : '200px',

                    render : function(suggestion)
                    {
                        var icons = 'exclamation feed house information lock'.split(/ /g),
                                icon  = icons[hash(suggestion, icons.length)];
                        return  suggestion
                    }
                }
            })
            .bind('getSuggestions', function(e, data)
            {
                var list = [{$username}
                        ],
                        textext = $(e.target).textext()[0],
                        query = (data ? data.query : '') || '';

                $(this).trigger(
                        'setSuggestions',
                        { result : textext.itemManager().filter(list, query) }
                );
            });
    </script>
</body>

</html>